// on Windows

const {spawn} = require("child_process");
const cmd = spawn('cmd.exe', ['/c', 'dir']);

cmd.stdout.on('data', (data)=>{
    console.log(data.toString());
});

cmd.stderr.on('data', (data)=>{
    console.error(data.toString());
});

cmd.on('exit', (code)=>{
    console.log(`child exit with code ${code}`);
})

